<?php
//create.php

//** Each page that is "stand alone" must have this variable.
$authorizedPage = true; 
require('config.php');

define ('MAX_FILE_SIZE', 3145728);

?>

<!--Shell Start-->
<!DOCTYPE HTML>
<html>

<head>
<title>Create</title>
<link rel="stylesheet" type="text/css" href="libraries/style.css" />
<link rel="stylesheet" type="text/css" href="style/create.css" />

<script type="text/javascript" src="libraries/jq.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript" src="libraries/create.js"></script>
<script type="text/javascript" src="libraries/collapse.js"></script>
<script type="text/javascript" src="libraries/jquery.sticky.js"></script>
<script type="text/javascript" src="libraries/kinetic-v4.0.5.min.js"></script>
<script type="text/javascript" src="libraries/timeline.js"></script>
<script type="text/javascript" src="libraries/search.js"></script>
</head>

<body>
	
	<div id="contain">

		<div id="primitiveHead">
			<img id="logo" alt="Friendly Cooks" src="images/logo.png" />
			<div id="logoContain"></div>
			<?php require('facebook/f_authenticate.php'); ?>
			<form method="get" action="searchresults.php">
				<input id="search" name="search" type="text" value="search..." />
				<input id="go" type="submit" name="searchGO" value="Go!" />
			</form>
			<a href="create.php"><img id="create" src="images/createrecipe.png" /></a>
		</div>
	

	
		<div id="primitiveBody">
			<h1>Create a Recipe!</h1>
			
			<?php //Check if user logged in ?>
			
			<div class="primitiveContent">
			
			<div id="timeLineWrap">
				<div id="timeLine"></div>
				
			</div>
			
			<div class="timeLineSpace">
				
			</div>
			
			<div class="timelineText">
			
			Ticker Position: <span class="timelineCurrentPosition"></span> 
			Stage Position: <span class="timelineStagePosition"></span>
			Recipie Length: <span class="timelineRecipieLength"></span>
			
			
			</div>
						
			<input type="hidden" id="totalTime" value="1500" />
						
				<form method="post" action="insertcreate.php" enctype="multipart/form-data"/>
				<input type="hidden" name="createGo" value="1"/>
				
				<h5 class="active toggle">Name</h5>
				<div class="toToggle">
					Recipe Name:
					<span class="userInput2">
						<input type="text" name="rName" class="textFieldUser"/>
					</span>
				</div>
				
			
				<h5 class="toggle">Description</h5>
				<div class="toToggle">
					Recipe Description:
					<span class="userInput2">
						<textarea name="description"></textarea>
					</span>
					<span class="userInput"2">
						Picture:
					<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE;?>" />
						<input type="file" name="image" />
					</span>
				</div>
				
				<h5 class="toggle">Steps</h5>
				
					<div id="stepsDiv" class="toToggle">
						<input type="hidden" id="stepCount" value="1" />
						<input type="button" id="stepAdd" value="Add a Step" class="listAdd" />
						<ol id="stepSort">
							<li class="step1"> 
								<span class="userInput stepP">
									<input type="text" name="step[]" class="textFieldUser steps" data-count="1" />
									<input type="text" name="time[]" class="time" />
									<input type="button" class="removeItem stepRemove" data-num="step1" value="Remove" />
									<span class="hide">Drag to Reorder</span>
									<input type="file" name="stepImage[]" /> Max Image Size is 3MB.
								</span>
							</li>
						</ol>
					</div>
				
				
				<h5 class="toggle">Ingredients</h5>
				<div class="toToggle">
					<input type="hidden" id="ingredientCount" value="1" />
					<input type="button" id="ingredientAdd" value="Add an Ingredient" class="listAdd" />
					<ol id="ingredientSort">
						<li class="ingredient1"> 
							<span class="userInput">
								<input type="text" name="ingredient[]" class="textFieldUser" data-count="1" />
								<input type="button" class="removeItem ingredientRemove" data-num="ingredient1" value="Remove" />
								<span class="hide">Drag to Reorder</span>
								<input type="file" name="ingredientImage[]" /> Max Image Size is 3MB.							
							</span>
						</li>
					</ol>
				</div>
				
				<h5 class="toggle">Materials</h5>
				<div class="toToggle">
					<input type="hidden" id="materialCount" value="1" />
					<input type="button" id="materialAdd" value="Add a Material" class="listAdd" />
					<ol id="materialSort">
						<li class="material1"> 
							<span class="userInput">
								<input type="text" name="material[]" class="textFieldUser" data-count="1" />
								<input type="button" class="removeItem materialRemove" data-num="material1" value="Remove" />
								<span class="hide">Drag to Reorder</span>
								<input type="file" name="materialImage[]" /> Max Image Size is 3MB.
							</span>
						</li>
					</ol>
				</div>
				
				<h5 class="toggle">Finish</h5>
				<div class="toToggle">
					<input type="submit" name="createIt" value="Create Recipe!" />
					</form>
				</div>
			</div>
			
			
			<div id="primitiveFoot">
			<img id="minilogo" alt="Friendly Cooks" src="images/logo.png" />
			
				<span id="footLinks">
					<a href="index.php">Home</a> |
					<a href="create.php">Create</a> |
					<a href="view.php">View</a> |
					<a href="search.php">Search</a> |
					<a href="privacy.php">Privacy</a> |
					<a href="contact.php">Contact</a> |
					<a href="account.php?id=<?php echo ($user ? $user_profile['id'] : -1);  ?>" id="accountFoot">My Account</a>

					
					<span>&copy; 2012 Friendly Cooks</span>
				</span>
			</div>
			
		</div>
		
	</div>


</body>
</html>

<?php
mysql_close();

?>